Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(vote): add vote component #INF-169 #458

Merged
merged 4 commits into from
Dec 18, 2019
Merged

feat(vote): add vote component #INF-169 #458

merged 4 commits into from
Dec 18, 2019

Conversation

ls32140
Copy link
Contributor

@ls32140 ls32140 commented Dec 17, 2019

No description provided.

Comment on lines 77 to 84
(this._classNames || []).forEach((value: string) => {
this.renderer.removeClass(this._nativeElement, value);
});

this._classNames = className;
this._classNames.forEach((value: string) => {
this.renderer.addClass(this._nativeElement, value);
});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个地方使用 UpdateHostClassService 他会自动做移除样式和追加样式的逻辑

}

_setClassesByType() {
const className = [];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

最好设置一个变量 initialized,否则会在加载组件的时候调用这个逻辑很多次

templateUrl: './vote.component.html'
})
export class ThyVoteComponent implements OnInit {
private _nativeElement: any;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

可以使用 HTMLElement 类型

}

@Input()
set thyVoteType(value: ThyVoteType) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个改成 thyLayout 最好, 去掉 Vote

@why520crazy why520crazy merged commit 62d77b3 into master Dec 18, 2019
@why520crazy why520crazy deleted the vote branch December 18, 2019 06:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants